package com.scs.application.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.BaseEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
* @Description： 流程实例表，主键跟bus_id保持一致
*/
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "流程实例表")
@TableName("sys_flow_execution")
@EntityIndexAnnotation(ix = {"flow_key"},ux = {"bus_id"})
public class FlowExecution extends BaseEntity {
    @EntityFieldAnnotation(
            type = EntityFieldType.LONG
    )
    public String id;

    @EntityFieldAnnotation(
            text = "业务ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busId;

    @EntityFieldAnnotation(
            text = "业务单号",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busKey;

    @EntityFieldAnnotation(
            text = "业务表",
            length = "",
            not_null = true,
            comment = "小写"
    )
    private String busTable;

    @EntityFieldAnnotation(
            text = "业务类型名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = "所操作的菜单名称"
    )
    private String busTypeName;

    @EntityFieldAnnotation(
            text = "流程标识",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String flowKey;

    @EntityFieldAnnotation(
            text = "流程名称",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String flowName;


    /************************* 以下字段会随着节点变化********************************/

    @EntityFieldAnnotation(
            text = "最近操作日期",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date busDate;

    @EntityFieldAnnotation(
            text = "最近操作人",
            length = "20",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String busUser;


    @EntityFieldAnnotation(
            text = "流程状态编码，与业务表状态保持一致",
            length = "20",
            not_null = true,
            comment = ""
    )
    public String flowStatus ;

    @EntityFieldAnnotation(
            text = "流程状态描述，与业务表状态保持一致",
            length = "100",
            not_null = true,
            comment = ""
    )
    public String flowStatusText ;

    @EntityFieldAnnotation(
            text = "备注，冗余",
            length = "200",
            not_null = false,
            comment = ""
    )
    public String remark ;
}
